package com.fms.data.messaging.auth;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

import com.fms.model.messaging.auth.IAuthentication;

public class EmailAuthentication extends Authenticator
{
	private IAuthentication auth;
	
	
	public EmailAuthentication(IAuthentication _auth)
	{
		auth = _auth;
	}
	
	@Override
	protected PasswordAuthentication getPasswordAuthentication()
    {			
		
		PasswordAuthentication a = new PasswordAuthentication(auth.getUser(), new String(auth.getPassword()));
		return a;//auth.getUser(), auth.getPassword().toString());
    }
}
